package com.lfy.modules.common.custom.constants;

import lombok.AllArgsConstructor;
import lombok.Getter;

import java.util.Arrays;
import java.util.Map;
import java.util.stream.Collectors;
@AllArgsConstructor
@Getter
public enum FileTypeEnum {
    FOLDER(0,"文件夹"),
    MUSIC(1,"音乐文件"),
    VIDEO(2,"视频文件"),
    ZIP(3,"压缩文件"),
    IMAGE(4,"图片文件"),
    DOCUMENT(5,"文本文件"),
    WORD(6,"Word文档"),
    PDF(7,"PDF文档"),
    XXX(8,"其他文件"),


    ;
    static {
        map = Arrays.stream(FileTypeEnum.values()).collect(Collectors.toMap(item -> item.code, item -> item.msg));
    }
    final Integer code;
    final String msg;
    private static Map<Integer, String> map;
    public static String getMsg(Integer code) {
        if (code == null) {
            return null;
        }
        return map.get(code);
    }

}
